# Purpose: Make treatment groups easier to use

# Packages
library(readr)
library(dplyr)

# import treatment groups
treatment_groups <- read_csv("data/1_raw/treatment_groups_raw.csv") 

# convert treatment status labels
treatment_groups <- treatment_groups |> 
  mutate(treatment_status = case_when(
    grepl("Top", Treatment) ~ "TD",
    grepl("Bottom", Treatment) ~ "BU",
    grepl("Control", Treatment) ~ "Control",
    grepl("Both", Treatment) ~ "BOTH"
  ),
  Treatment = NULL)

# save
write_csv(treatment_groups, "data/2_clean/treatment_groups.csv")
